//
// Created by 11510 on 2024/6/17.
//
#include <iostream>
using namespace std;

class Base{
public:
    Base(long x): _base(x){
        cout << "Base()" << endl;
    }
    long _data = 100;

    void print(){
        printf("parent\n");
    }
private:
    long _base;
};
class Derived: public Base{
public:
    Derived(long base,long derived)
    : Base(base), _derived(derived){
        cout << "Derived()" << endl;
    }
    long _data = 19;
    void print(int a){
        printf("child\n");
    }
private:
    long _derived;
};

void test0(){
    Derived derived(1, 2);
    /* 写法有点古怪 */
    /* 子类对父类的成员隐藏 */
    printf("%ld\n", derived.Base::_data);
//    printf("size derived %ld\n", sizeof(Derived));
    derived.Base::print();
    derived.print(1);
}


int main() {
    test0();
    return 0;
}
